Server Vs Workstation GC

1 min read
Rapid overview

GC Behavior: Browser vs Node.js

JavaScript engines tune GC differently depending on environment and workload.


Browser focus

  • Prioritize UI responsiveness and low-latency pauses.
  • Avoid long GC pauses that impact user input.

Node.js focus

  • Throughput for server workloads.
  • Larger heaps and background GC under load.

Practical guidance

  • Keep allocations low in hot UI loops.
  • Use streaming and backpressure for Node.js services.
  • Monitor memory usage and long tasks.

Interview prompt

  • How do GC pauses show up in the browser?